#include <fsnotify.h>
#include <stdio.h>

int main()
{
    struct dentry *d1 = dentry_new("dir1");
    struct dentry *d2 = dentry_new("dir2");
    struct dentry *d3 = dentry_new("dir3");
    GString *path;
    dentry_add_child(d1, d2);
    dentry_add_child(d2, d3);
    path = dentry_get_path(d3, NULL);
    printf("%s\n", path->str);
    g_string_free(path, TRUE);

    int i;
    struct dentry *d = dentry_new("dir0");
    for (i = 0; i < 1024; ++i) {
        struct dentry *t;
        char buf[32];

        sprintf(buf, "dir%d", i + 1);
        t = dentry_new(buf);
        dentry_add_child(d, t);
        d = t;
    }
    path = dentry_get_path(d, NULL);
    printf("%s\n", path->str);
    g_string_free(path, TRUE);
    return 0;
}
